<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style>
.error {
	color: red;
}

.errorblock {
	width: 300px;
	color: #000;
	background-color: #ffEEEE;
	border: 1px solid #ff0000;
	padding: 1px;
	margin: 0px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<h1 align="center">User's registration</h1>

	<form:form method="POST" modelAttribute="registration">
		<center>
			<c:if test="${checkUsername!=null}">
				<div class="errorblock" align="left">This username is already
					taken!</div>
			</c:if>

			<c:if test="${checkEmail!=null}">
				<div class="errorblock" align="left">User with the email you
					specified already exists!</div>
			</c:if>
			<c:if test="${checkPassword==false}">
				<div class="errorblock" align="left">different passwords
					entered!</div>
			</c:if>

			<table>
				<tr>
					<th align="right">Firstname:</th>
					<td align="left"><form:input path="firstname" /><br>
					</td>
					<td><form:errors path="firstname" cssClass="error" />
					</td>
					<td>
				</tr>
				<tr>
					<th align="right">Lastname:</th>
					<td><form:input path="lastname" /><br>
					</td>
					<td align="left"><form:errors path="lastname" cssClass="error" />
					</td>

				</tr>
				<tr>
					<th align="right">Username:</th>
					<td align="left"><form:input path="username" /><br>
					</td>
					<td align="left"><form:errors path="username" cssClass="error" />
					</td>

				</tr>
				<tr>
					<th align="right">Password:</th>
					<td><form:password path="password" size="21" /> <br>
					</td>
					<td align="left"><form:errors path="password" cssClass="error" />
					</td>
				</tr>
				<tr>
					<th align="right">Confirm password:</th>
					<td><form:password path="confirm" size="21" /><br>
					</td>
					<td align="left"><form:errors path="confirm" cssClass="error" />
				</tr>
				<tr>
					<th align="right">Email:</th>
					<td><form:input path="email" /> <br>
					</td>
					<td align="left"><form:errors path="email" cssClass="error" />
					</td>

				</tr>
				<tr>
					<td align="center"></td>
					<td align="center"><input type="submit"
						style="width: 70px; height: 25px" name="save" value="Save">
					</td>
			</table>

		</center>

	</form:form>
</body>
</html>